import requests

BASE_URL = 'http://localhost:8080/api/user/info'

def load_token():
    with open('token.txt', 'r') as file:
        return file.read().strip()

TOKEN = load_token()

def get_info():
    headers = {'Authorization': f'Bearer {TOKEN}'}
    response = requests.get(BASE_URL, headers=headers)
    print("code = " + str(response.status_code ))
    if response.status_code == 200:
        print('get info successfully:', response.json())
    else:
        print('Failed to fetch:', response.json())

if __name__ == '__main__':
    get_info()
